# script1503.py - Record a Swallow Sighting
# Written by Blum and Bresnahan
#
############ Import Modules  ##################
#
# Birds object file
from birds import Bird
#
# Barn Swallow object file
from barnswallow import BarnSwallow
#
# South Africa Cliff Swallow object file
from sacliffswallow import SouthAfricaCliffSwallow
#
# Sightings object file
from sightings import Sighting
#
# Birds sightings object file
from sightings import BirdSighting
#
# Import Date Time function
import datetime
#
################################################
def main ():	#Mainline
	###### Create Variables & Object Instances ###
	#
	flock_size='0'	#Number of birds sighted
	sex='unknown'  	#Male, female, or unknown
	species=''	#Barn or Cliff Swallow Object
	#
	barn_swallow=BarnSwallow(sex,flock_size)
	sa_cliff_swallow=SouthAfricaCliffSwallow(sex,flock_size)
	#
	location='unknown'	#Location of sighting
	date='unknown'		#Date of sighting
	#
	bird_sighting=BirdSighting(location,date,species,flock_size)
	#
	###### Instructions for Script User #########
	print()
	print("The following characteristics are listed")
	print("in order to help you determine what swallow")
	print("you have sighted.")
	print()
	#
	###### Show Barn Swallow Characterstics #####
	#
	print("A barn swallow is a bird that", end=' ')
	if barn_swallow.get_migratory() == 'yes':
    		print("is migratory.")
	else:
    		print("is not migratory.")
	#
	######## Show Cliff Swallow Characterstics ######
	#
	print("A cliff swallow is a bird that", end=' ')
	if sa_cliff_swallow.get_migratory() == 'yes':
    		print("is migratory.")
	else:
    		print("is not migratory.")
	#
	######## Obtain Swallow Sighted #################
	print()
	print("Which did you see?")
	print("European/Barn Swallow    - 1")
	print("African Cliff Swallow    - 2")
	species = input("Type number & press Enter: ")
	print()
	#
	######## Obtain Sighting Information #################
	#
	location=input("Where did you see the birds? ")
	print()
	flock_size=int(input("Approximately, how many did you see? "))
	#
	###### Mutate Sighted Birds' Information ####
	#
	bird_sighting.set_sight_location(location)
	bird_sighting.set_sight_date(datetime.date.today())
	if species == '1': 
		bird_sighting.set_bird_species('barn swallow')
	else:
		bird_sighting.set_bird_species('SA cliff swallow')
	bird_sighting.set_flock_size(flock_size)
	#
	###### Display Sighting Data ################
	print()
	print("Thank you.")
	print("The following data will be forwarded to")
	print("the Great Backyard Bird Count.")
	print("www.birdsource.org/gbbc")
	#
	print()
	print("Sighting Date: \t", bird_sighting.get_sight_date())
	print("Location: \t", bird_sighting.get_sight_location())
	if species == '1':
		print("Species: \t European/Barn Swallow")	
	else:
		print("Species: \t South Africa Cliff Swallow")	
	print("Flock Size: \t", bird_sighting.get_flock_size())
#
#########################################################
#
########## Call the main function #######################
main()
